#include "Common.h"
#include "ConcurrentAlloc.h"
#include <iostream>
void Alloc1()
{
	for (int i = 0; i < 5; i++)
	{
		void* ptr = ConcurrentAlloc(6);
		
	}
	
}

void Alloc2()
{
	for (int i = 0; i < 5; i++)
	{
		void* ptr = ConcurrentAlloc(7);
	}
}
void TLSTest()
{
	std::thread t1(Alloc1);
	std::thread t2(Alloc2);

	t1.join();
	t2.join();
}

void Alloc3()
{
	void* p1 = ConcurrentAlloc(7);
	void* p2 = ConcurrentAlloc(6);
	void* p3 = ConcurrentAlloc(12);
	void* p4 = ConcurrentAlloc(7033);
	char* p = (char*)p4;
	std::cout << "size1 :> " << sizeof(*(char*)p1) << std::endl;
	std::cout << "size2 :> " << sizeof(*(char*)p2) << std::endl;
	std::cout << "size3 :> " << sizeof(*(char*)p3) << std::endl;
	std::cout << "size4 :> " << sizeof(*(char*)p4) << std::endl;
}

int main()
{
	//TLSTest();
	Alloc3();
	
	return 0;
}